package com.system.database;

import javax.sql.DataSource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class DataSourceConfig {
	public static final Logger log = LoggerFactory.getLogger(DataSourceConfig.class);
	@Bean(name = "frameDb")
	@ConfigurationProperties(prefix = "frameDb",locations="classpath:config/db.properties")
	public DataSource frameDbDataSource() {
		log.debug("frameDb....");
		return DataSourceBuilder.create().build();
	}
	@Bean(name = "formDb")
	@ConfigurationProperties(prefix = "formDb",locations="classpath:config/db.properties")
	public DataSource formDbDataSource() {
		log.debug("formDb....");
		return DataSourceBuilder.create().build();
	}
	@Bean(name = "businessDb")
	@ConfigurationProperties(prefix = "businessDb",locations="classpath:config/db.properties")
	public DataSource businessDbDataSource() {
		log.debug("businessDb....");
		return DataSourceBuilder.create().build();
	}
}
